
package com.sinochem.yunlian.ship.common.enums;

/**
 * @Auther: zzd
 * @Dscription:
 * @Date: Create in 2017/11/23 10:08
 **/
public enum MaterialStatus {

    CANCLE(-3000,"已取消"),
    OVERDUE(-2000,"已过期"),
    DRAFT(-500,"草稿"),
    INIT(0,"未报价"),
    BID(1000,"报价中"),
    DONE(5000,"已完成");

    private int code;

    private String name;

    MaterialStatus(int code , String name){
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String valueOf(int code){
        String name = "";
        switch ( code ) {
            case -3000:
                name = "已取消";
                break;
            case -2000 :
                name = "已过期";
                break;
            case -500 :
                name = "草稿";
                break;
            case 0:
                name = "待报价";
                break;
            case 1000 :
                name = "报价中";
                break;
            case 5000 :
                name = "已完成";
                break;
            default:
                name = "";
                break;
        }
        return name;
    }
}
